<script type="text/javascript" src="__JS__/jquery-1.4.1.js"></script>
<script type="text/javascript" src="__JS__/formValidator.js"></script>
<script type="text/javascript" src="__JS__/formValidatorRegex.js"></script>
<link type="text/css" rel="stylesheet" href="__CSS__/validator.css">
<link href="__CSS__/Team/thickbox.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	//关闭弹出页
	function ClosePage() {
		parent.tb_remove();
	}
	$(document).ready(function () {
		
		$.formValidator.initConfig({ formid: "form1", onerror: function (msg) { alert(msg) }, onsuccess: function () { return true; } });
		$("#txtTeamName").formValidator({ onshow: "团队名称仅限由汉字、字母、数字组成，1-16个字符", onfocus: "团队名称注册完后不能修改！请选择一个闪亮，方便记忆的名字", oncorrect: "&#12288;", defaultvalue: "" }).regexValidator({ regexp: "^[\u4e00-\u9fa5A-Za-z0-9]*$", onerror: "你输入的团队名称非法,团队名称仅限由汉字、字母、数字组成" }).inputValidator({ min: 1, max: 32, onerror: "你输入的团队名称长度非法,团队名称仅限由汉字、字母、数字组成，1-16个字符,请确认" }).ajaxValidator({
			type: "get",
			url: "__APP__/Team/Index/teamName",
			data:{name:$('#txtTeamName').val()},
			datatype: "json",
			success: function (data) {
				if (data.status == 1) {
					
					return true;
				}
				else {
					
					return false;
				}
			},
			buttons: $("#button"),
			error: function () { alert("服务器没有返回数据，可能服务器忙，请重试"); },
			onerror: "此团队名称已经使用，换一个名称吧",
			onwait: "正在对团队名称合法性校验，请稍候..."
		});

		$("#txtTeamFetion").formValidator({ onshow: "请输入团队飞信号", onfocus: "飞信号将是组委会与团队联系的重要工具之一，一定要认真填写", oncorrect: "输入合法" }).inputValidator({ min: 1, empty: { leftempty: false, rightempty: false, emptyerror: "飞信号两边不能有空符号" }, onerror: "飞信号不能为空,请确认" }).regexValidator({ regexp: "^\s*[.0-9]{9}\s*$", onerror: "你输入的飞信号格式不正确" });
		$("#txtTeamDeclaration").formValidator({ onshow: "请输入你的描述", onfocus: "不要超过200字哦，否则会显示不完整", oncorrect: "漂亮的团队宣言，祝你成功" }).inputValidator({ min: 1, max: 400, onerror: "你输入的描述长度不正确,请确认" });
		parent.Resize(500, 550);
	});
	function btnCancel_onclick() {
		ClosePage();
	}
</script>
<style type="text/css">
	td{
		border:1px dotted #ddd;
		margin:5px auto;
	}
	
</style>

<form enctype="multipart/form-data" id="form1" action="__APP__/Team/Index/createTeam" method="post" name="form1">
	<table>
		<tbody  id="tid">
			<tr>
				<td>
					*团队名称：<input type="text" style="width:280px;" id="txtTeamName" maxlength="16" name="Name" value="" />
				</td>
			</tr>
			<tr>
				<td>
					<div id="txtTeamNameTip" class="onShow">请输入团队名称（1-16）</div>
				</td>
			</tr>
			<tr>
				<td>团队LOGO：<input type="file" style="width:280px;" id="fuLogo" name="Logo" />&nbsp;</td>
			</tr>
			<tr>
				<td style=" font-size:12px;">		你团队的logo可以是JPG、GIF、BMP或者PNG格式的图片，大小不要超过1M哦，尺寸最好是120*120</td>
			</tr>
			<tr>
				<td>
					*团队飞信：<input type="text" style="width:280px;" id="txtTeamFetion" name="Fetion" />
				</td>
			</tr>
			<tr>
				<td>
					<div id="txtTeamFetionTip" class="onShow">请输入团队飞信号</div>
				</td>
			</tr>
			<tr>
				<td>
					团队宣言：
				</td>
			</tr>
			<tr>
				<td>
					<textarea style="resize:none" id="txtTeamDeclaration" cols="50" rows="5" name="Declaration" ></textarea>
				</td>
			</tr>
			<tr>
				<td>
					<div id="txtTeamDeclarationTip" class="onShow">请输入你的描述</div>
				</td>
			</tr>
			<tr>
				<td>队长：{$user.TrueName}<span style=" margin-left:70px;">所在高校</span>：{$user.OrgName}</td>
			</tr>
			<tr>
				<td>
					<input type="submit" style="border: 0; cursor: pointer;
						width: 75px; height: 38px; background: url(__ROOT__/Image/createteam.gif)" id="btnCreateTeam" value="" />&nbsp;&nbsp;
					<input type="button" class="closeload" onclick="self.parent.tb_remove();" style="border: 0; cursor: pointer; width: 75px;height: 38px; background: url(__ROOT__/Image/cancel.gif)" value="" id="btnCancel" />
				</td>
			</tr>
		</tbody>
	</table>
</form>
